<template>
  <el-input
    v-bind="$attrs"
    v-on="$listeners"
    @input="onInput"
    clearable
  ></el-input>
</template>

<script>
export default {
  methods: {
    onInput(e) {
      let str = e.replace(/^\./, "0.");
      str = str.replace(/(?<=.+\w.*)\./, "");
      e = str.replace(/^0+|[^0-9]/g, "");
      this.$emit("input", e);
    },
  },
};
</script>

<style></style>
